-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement contactListMapFromJson() and contactListMapToJson() methods #316
Conversation
src/Contacts/include/BipedalLocomotion/Contacts/ContactListParser.h
Outdated
Show resolved
Hide resolved
9f3ca6c
to
83225a1
Compare
83225a1
to
1e8c53a
Compare
@traversaro before merging (or just after) the PR we should add:
|
@S-Dafarra if you agree I can merge the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I somehow lost this
* Parse a ContactListMap from a JSON file. | ||
* @param filename the name of the file that should be loaded. | ||
* @return return a ContactListMap containing all the contacts. | ||
* @note The JSON file should have the following structure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @note The JSON file should have the following structure | |
* @note The JSON file should have a structure similar to the following example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it would be nice to comment somewhere why the index is always -1. For example, you could mention that those parameters are the same of Contact
. Also, left
and right
should resemble more a custom name, like my_left_foot
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I did some modifications f14c9d6
what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me.
As a doublecheck, I also tried to store a sequence of footsteps from hadherent through contact_list_map_to_json()
, which then @GiulioRomualdi was able to read.
This PR closes #315 in detail I used nlohmann json to parse the JSON file.
The two functions can be used to store and read from a JSON file the contact lists.
TODO
apt
)